import Vue from 'vue'
import Vuex from 'vuex'
import * as getters from './getters'
import * as mutations from './mutations'
import * as actions from './actions'

import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex)

const store = new Vuex.Store({
  //定义状态
  state: {
    commentDB:[ {
      id:0,
      time:'2021/7/1 9:48:22',
      replyList:[],
      content:'test',
      indent:0,
      parentId:-1,
      nickname:'匿名',
    },
      {
        id:1,
        time:'2021/7/1 10:17:4',
        replyList:[],
        content:'test2',
        indent:0,
        parentId:-1,
        nickname:'233',
      }],

  },
  getters,
  mutations,
  actions,
  plugins: [createPersistedState()]
})

export default store
